package com.hjwoo.app.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hjwoo.app.R;

public class SelectLVAdapter extends BaseAdapter
{

    Context    context;
    // 定义一个视图容器
    ViewHolder holder;
    // 定义一个商品集合
//	List<Data> myWareHouseS;
    // 用来导入布局
    private LayoutInflater inflater = null;

    public SelectLVAdapter(Context context)
    {
        super();
        this.context = context;
        inflater = LayoutInflater.from(context);
        // 创建bitmap
    }
//	public LeadsLVAdapter(Context context, List<Data> myWareHouseS) {
//		super();
//		this.context = context;
//		this.myWareHouseS = myWareHouseS;
//		inflater = LayoutInflater.from(context);
//		// 创建bitmap
//	}

    @Override
    public int getCount()
    {
        return 9;
//		return myWareHouseS.size();
    }

    @Override
    public Object getItem(int arg0)
    {
        return arg0;
    }

    @Override
    public long getItemId(int arg0)
    {
        return arg0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
        // 定义一个视图容器
        holder = null;
        if (convertView == null)
        {
            // 获取ViewHolder对象
            holder = new ViewHolder();
            // 导入布局并赋值给convertview
            convertView = inflater.inflate(R.layout.item_leads_lv, null);
//			holder.sv_warehouse_tv = (TextView) convertView
//					.findViewById(R.id.sv_warehouse_tv);
            convertView.setTag(holder);
        }
        else
        {
            // 取出holder
            holder = (ViewHolder) convertView.getTag();
        }
        // 设置商品详情
//		holder.sv_warehouse_tv.setText(myWareHouseS.get(position)
//				.getWarehouseName());

        return convertView;
    }

    /**
     * 视图容器类
     *
     * @author kz
     */
    public static class ViewHolder
    {
        // 商品描述
        public TextView sv_warehouse_tv;
    }

}
